<template>
    <div class="toast">
        <p>{{ content }}</p>
    </div>
</template>

<script>
export default {
    data() {
        return {
            content: "",
            duration: 3000
        }
    },
    mounted() {
        setTimeout(() => {
            console.log(this.content);
            this.$destroy(true);
            this.$el.parentNode.removeChild(this.$el)
        },this.duration)
    }
}
</script>

<style scoped lang="less">
.toast {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 5rem;
    left: 0;
    right: 0;
    color: #fff;
    z-index: 9999;
    background: transparent;
    p {
        padding: 1rem;
        font-size: 18px;
        border-radius: 1rem;
        background: rgba(17,17,17,0.7);
    }
}
</style>